﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Meraz.Core.Data;
using System.Runtime.Serialization;

namespace Meraz.Core.Model
{
    [PetaPoco.TableName("facebookboard")]
    [PetaPoco.PrimaryKey("ID", autoIncrement = false)]
    [PetaPoco.ExplicitColumns]
    [Serializable]
    [DataContract]
    public class FacebookTopicBoard
    {
        public FacebookTopicBoard() { Topics = new List<FacebookTopic>(); }

        [PetaPoco.Column]
        [DataMember]
        public long ID { get; set; }

        [PetaPoco.Column]
        [DataMember]
        public string Name { get; set; }

        [DataMember]
        public List<FacebookTopic> Topics { get; set; }


        public override string ToString()
        {
            StringBuilder builder = new StringBuilder();
            builder.Append("{");
            builder.AppendFormat("{0}:{1},", "ID", ID);
            builder.AppendFormat("{0}:{1},", "Name", Name);
            builder.AppendLine("Topics:{");
            foreach (FacebookTopic topic in Topics)
                builder.AppendLine(topic.ToString());
            builder.AppendLine("}");
            return builder.ToString();
        }
    }
}
